﻿@{ Layout = "~/Views/Shared/_leftPanelLayout.cshtml";}
@section LeftTree
{
     
    @{
        Html.RenderPartial("DeptTreePartialView", new Webcar.Models.DeptTreeMode { Action = "List", Controller = "CarSend", ShowChild = false });
     }
}

@using (Ajax.BeginForm("ListPartialView", "CarSend",Html.ViewContext.RouteData.Values, new AjaxOptions
    {
        HttpMethod = "POST",
        UpdateTargetId = "list-car",
        InsertionMode = System.Web.Mvc.Ajax.InsertionMode.Replace
    }))
    { 
        @UserQuery.CreateQuery(setting => {
       setting.QueryKey = QuerySettings.CarSendList;
       setting.Columns.Add(new QueryColumn() { Field = "record_no", Name = "牌照号" });
           setting.Columns.Add(new QueryColumn() { Field = "driver_name", Name = "驾驶员" });
           setting.Columns.Add(new QueryColumn() { Field = "place", Name = "往返地点" });
           setting.Columns.Add(new QueryColumn() { Field = "start_date", Name = "开始时间", DataType = TypeofQueryColumn.Date } );
           setting.Columns.Add(new QueryColumn() { Field = "end_date", Name = "结束时间", DataType = TypeofQueryColumn.Date } );
           setting.Columns.Add(new QueryColumn() { Field = "send_man", Name = "派车人" });
           setting.Columns.Add(new QueryColumn() { Field = "reason", Name = "事由"});
        })
}
<div id="list-car">
    @Html.Action("ListPartialView")
</div>
<hr />
 @Html.DevExpress().Button(settings =>
{
    settings.Name = "Button1";
    settings.Text = "增加派车单";
    settings.Width = 120;
    settings.ControlStyle.CssClass = "button1";
    settings.ClientSideEvents.Click = "function(s, e){ location.href='" + @Url.Action("Edit", "CarSend")+"' }";
}).GetHtml()

